import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ict.ycwl.common.web.AjaxResult;
import com.ict.ycwl.pathcalculate.PathCalculateApplication;
import com.ict.ycwl.pathcalculate.controller.PathController;
import com.ict.ycwl.pathcalculate.pojo.Route;
import com.ict.ycwl.pathcalculate.service.RouteService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;
import java.util.stream.Collectors;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = PathCalculateApplication.class)
public class test {

    @Autowired
    RouteService routeService;


    @Test
    public void doTest(){
        QueryWrapper<Route> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_delete",0);
        List<Long> collect = routeService.list(queryWrapper).stream().map(Route::getRouteId).collect(Collectors.toList());
        for (Long routeId : collect) {
            routeService.getWorkTime(routeId);
        }
    }

}
